package com.lijianlove.message.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author lijian
 * @date 2019/5/29 下午4:06
 */
@Getter
@AllArgsConstructor
public enum MsgStatusEnum {

    INIT(0, "待确认", "待确认，初始化"),
    WAIT(1, "已确认", "已投递，等待执行"),
    DOING(2, "执行中", "执行中"),
    SUCCESS(3, "执行成功", "执行成功"),
    FAIL(4, "执行失败", "执行失败"),
    FINAL_FAIL(5, "最终失败", "最终失败"),;

    private Integer value;
    private String desc;
    private String detail;

    public static MsgStatusEnum getByValue(Integer value) {
        for (MsgStatusEnum msgStatusEnum : MsgStatusEnum.values()) {
            if (msgStatusEnum.getValue().equals(value)) {
                return msgStatusEnum;
            }
        }
        return null;
    }
}
